home *** CD-ROM | disk | FTP | other *** search
- // ==================================================
- // CTouchMePref.h
- // Copyright (C) 1996 Mizutori Tetsuya, July 4 1996.
- // ==================================================
- // All documents are pretty-printed in Geneva 10-point font.
-
- #pragma once
-
- #include "LPrefsFile.h"
-
-
- typedef enum {
- touchType_CreationDate = 0,
- touchType_ModificationDate,
- touchType_END
- } ETouchType;
-
-
- typedef enum {
- touchFlag_Current = 0,
- touchFlag_Direct,
- touchFlag_First,
- touchFlag_Second,
- touchFlag_END
- } ETouchFlag;
-
-
- typedef struct {
- Uint32 version;
- Rect wframe;
- Int16 sync;
- Int16 reserved_1;
- Int16 enabled[touchType_END];
- Int16 flag[touchType_END];
- Uint32 datetime[touchType_END];
- } SPrefRec, *SPrefPtr, **SPrefHandle;
-
-
- class CTouchMePref : public LPrefsFile {
-
- public:
- CTouchMePref();
- CTouchMePref( ConstStr255Param inFileName );
- virtual ~CTouchMePref();
-
- // Read and Write preferences data to/from Prefs file using 'SPrefRec'.
- OSErr LoadPrefData( void );
- OSErr SavePrefData( void );
-
- // Set and Get preferences data.
- void SetWindowRect( const Rect & inWindowRect );
- void GetWindowRect( Rect & outWindowRect );
-
- void SetSync( const Boolean inStatus );
- Boolean GetSync( void );
-
- void SetEnabled( const ETouchType inType, const Boolean inStatus );
- Boolean GetEnabled( const ETouchType inType );
-
- void SetFlag( const ETouchType inType, const ETouchFlag inFlag,
- const Boolean inStatus );
- Boolean GetFlag( const ETouchType inType, const ETouchFlag inFlag );
-
- void SetFlagNumb( const ETouchType inType, const ETouchFlag inFlag );
- ETouchFlag GetFlagNumb( const ETouchType inType );
-
- void SetDateTime( const ETouchType inType, const unsigned long inValue );
- unsigned long GetDateTime( const ETouchType inType );
-
- void SetDateString( const ETouchType inType, const Str255 inDateStr );
- void GetDateString( const ETouchType inType, Str255 outDateStr );
- void SetTimeString( const ETouchType inType, const Str255 inTimeStr );
- void GetTimeString( const ETouchType inType, Str255 outTimeStr );
-
- private:
-
- // Transform preferences data to/from 'SPrefRec' record.
- void TransformStructToMember( void );
- void TransformMemberToStruct( void );
-
- // Convert DateTime seconds with String
- void ConvertString2DateTime( const ETouchType inType );
- void ConvertDateTime2String( const ETouchType inType );
-
-
- unsigned long mVersion;
- Rect mWindowRect;
- Boolean mSync;
- Boolean mEnabled[ touchType_END ];
- ETouchFlag mFlag[ touchType_END ];
- unsigned long mDateTime[ touchType_END ];
- Str63 mDateStr[ touchType_END ];
- Str63 mTimeStr[ touchType_END ];
-
- SPrefRec mPrefRec;
- };
-
- // end of definitions
-